package cz.worsik.android.test.rideshare.db;

/**
 * Created by 231260 on 4.1.14.
 */
public class DbConstants {

    public static final String KEY_ROWID = "id";
    public static final Boolean DEBUG = true;

    public static final String DATABASE_NAME = "rideshare";

    public static final String DATABASE_DROP_1 = "DROP TABLE IF EXISTS contacts;";
    public static final String DATABASE_DROP_2 = "DROP TABLE IF EXISTS drivers;";
    public static final String DATABASE_DROP_3 = "DROP TABLE IF EXISTS driveways;";
    public static final String DATABASE_DROP_4 = "DROP TABLE IF EXISTS payments;";
    public static final String DATABASE_DROP_5 = "DROP TABLE IF EXISTS settings;";
    public static final String DATABASE_DROP_6 = "DROP TABLE IF EXISTS prizes;";

    public static final String DATABASE_CREATE_0 =
            "create table if not exists version ("
                    +"major integer ot null, "
                    +"minor integer not null"
                    +");";
    public static final String DATABASE_CREATE_1 =
            "create table if not exists contacts ("
                    +"id integer primary key autoincrement, "
                    + "name text not null"
                    +");";
    public static final String DATABASE_CREATE_2 =
            "create table if not exists drivers ("
                    +"id integer primary key autoincrement, "
                    +"contact_id integer not null, "
                    +"price integer not null"
                    +");";
    public static final String DATABASE_CREATE_3 =
            "create table if not exists driveways ("
                    +"id integer primary key autoincrement, "
                    +"price integer not null, "
                    +"direction boolean not null, "
                    +"date text not null, "
                    +"driver_id integer not null, "
                    +"passenger_id integer not null"
                    +");";
    public static final String DATABASE_CREATE_4 =
            "create table if not exists payments ("
                    +"id integer primary key autoincrement, "
                    +"amount integer not null, "
                    +"date text not null, "
                    +"receiving_id integer not null, "
                    +"paying_id integer not null, "
                    +"note text"
                    +");";
    public static final String DATABASE_CREATE_5 =
            "create table if not exists settings ("
                    +"id integer primary key autoincrement, "
                    +"name text not null, "
                    +"value text not null, "
                    +"note text"
                    +");";
    public static final String DATABASE_CREATE_6 =
            "create table if not exists prizes ("
                    +"driver_id integer not null, "
                    +"passenger_id integer not null, "
                    +"price integer not null"
                    +");";
}
